package com.yc.fruitmarket.controller;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.yc.fruitmarket.biz.callmeBiz;
import com.yc.fruitmarket.biz.impl.callmeBizImpl;

@WebServlet("/callmeController/*")
public class callmeController extends BaseServlet {
	private callmeBiz cb = new callmeBizImpl();
	//给管理员留言
	public void sendMessage(HttpServletRequest req, HttpServletResponse resp) {
		String uid = req.getParameter("uid");
		String subject = req.getParameter("subject");
		String content = req.getParameter("content");
		if(!"".equals(uid) && !"".equals(subject) && !"".equals(content)) {
			int reslut = cb.sendMessage(uid, subject, content);
			if(reslut > 0) {
				this.send(resp, 1);
			}else {
				this.send(resp, -1);
			}
		}else {
			this.send(resp, -1);
		}
	}
}
